<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 vector-feature-night-mode-enabled skin-theme-clientpref-os vector-sticky-header-enabled" lang="fr" dir="ltr"><head>
<meta charset="UTF-8">
<title>Gradle</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://fr.wikipedia.org/wiki/Gradle"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Gradle rootpage-Gradle skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Gradle</span></h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="fr" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="fr" dir="ltr"><div class="infobox_v3 infobox infobox--frwiki noarchive" style="width:260px">
<div class="entete icon informatique" style="background-color: #012F3C; color: #000000;"><style data-mw-deduplicate="TemplateStyles:r228712691">
/* start https://fr.wikipedia.org/ */
.mw-parser-output .entete.informatique{background-image:url("./_mw_/Picto.nfo.png")}
/* end https://fr.wikipedia.org/ */
</style>
<div><span style="color: #fff;">Gradle</span></div>
</div>
<div class="images">
</div>
<p class="mw-empty-elt">
</p>
<table><caption style="background-color:#012F3C;color:#000000;">Informations</caption>
<tbody><tr>
<th scope="row"><a href="D%C3%A9veloppeur" title="Développeur">Développé par</a></th>
<td>
Gradle Inc. et la communauté Gradle</td>
</tr>
<tr>
<th scope="row"> <a href="Version_d'un_logiciel" title="Version d'un logiciel">Première version</a>
</th>
<td>
<span class="wd_p571"><time>2008</time><sup id="cite_ref-wikidata-9e43a42fa799faa6409172039a9815a3e7ff29da_1-0" class="reference"><a href="#cite_note-wikidata-9e43a42fa799faa6409172039a9815a3e7ff29da-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></span></td>
</tr>
<tr>
<th scope="row"> <a href="Version_d'un_logiciel" title="Version d'un logiciel">Dernière version</a>
</th>
<td>
<span class="wd_p348">9.2.0 (<time class="nowrap" datetime="2025-10-29" data-sort-value="2025-10-29">29 octobre 2025</time>)<sup id="cite_ref-wikidata-54ce5103475c63d43ee3601e998746c68b1934a3_2-0" class="reference"><a href="#cite_note-wikidata-54ce5103475c63d43ee3601e998746c68b1934a3-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup></span></td>
</tr>
<tr>
<th scope="row"><a href="D%C3%A9p%C3%B4t_(informatique)" title="Dépôt (informatique)">Dépôt</a></th>
<td>
<span class="wd_p1324"><a rel="nofollow" class="external text" href="https://github.com/gradle/gradle">github.com/gradle/gradle</a></span></td>
</tr>
<tr>
<th scope="row"><a href="Assurance_qualit%C3%A9" title="Assurance qualité">Assurance qualité</a></th>
<td>
<span class="wd_p2992"><a href="Int%C3%A9gration_continue" title="Intégration continue">Intégration continue</a></span></td>
</tr>
<tr>
<th scope="row"> <a href="Langage_de_programmation" title="Langage de programmation">Écrit en</a>
</th>
<td>
<span class="wd_p277"><a href="Java_(langage)" title="Java (langage)">Java</a>, <a href="Groovy_(langage)" title="Groovy (langage)">Groovy</a> et <a href="Kotlin_(langage)" title="Kotlin (langage)">Kotlin</a></span></td>
</tr>
<tr>
<th scope="row"><a href="Syst%C3%A8me_d'exploitation" title="Système d'exploitation">Système d'exploitation</a></th>
<td>
<span class="wd_p306">Multiplateforme <small>(<a href="https://www.wikidata.org/wiki/Q174666" class="extiw external" title="d:Q174666"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small></span></td>
</tr>
<tr>
<th scope="row"><a href="Plateforme_informatique" title="Plateforme informatique">Environnement</a></th>
<td>
Multi-plateforme</td>
</tr>
<tr>
<th scope="row"> Type
</th>
<td>
<a href="Moteur_de_production" title="Moteur de production">Moteur de production</a></td>
</tr>
<tr>
<th scope="row"><a href="Licence_de_logiciel" title="Licence de logiciel">Licence</a></th>
<td>
<a href="Licence_Apache" title="Licence Apache">Licence Apache 2.0</a></td>
</tr>
<tr>
<th scope="row"><a href="Site_web" title="Site web">Site web</a></th>
<td>
<a rel="nofollow" class="external text" href="https://gradle.org">gradle.org</a></td>
</tr>
</tbody></table>
<p class="mw-empty-elt">
</p>
</div>
<p><b>Gradle</b> est un <a href="Moteur_de_production" title="Moteur de production">moteur de production</a> fonctionnant sur la plateforme Java. Il permet de construire des projets en <a href="Java_(langage)" title="Java (langage)">Java</a>, <a href="Kotlin_(langage)" title="Kotlin (langage)">Kotlin</a>, <a href="Scala_(langage)" title="Scala (langage)">Scala</a>, <a href="Groovy_(langage)" title="Groovy (langage)">Groovy</a> voire <a href="C%2B%2B" title="C++">C++</a>.
</p><p>Gradle allie les atouts de <a href="Apache_Maven" title="Apache Maven">Apache Maven</a> et <a href="Apache_Ant" title="Apache Ant">Apache Ant</a> : il allie l'utilisation de conventions à la manière de <a href="Apache_Maven" title="Apache Maven">Maven</a> (convention plutôt que configuration) avec la flexibilité de <a href="Apache_Ant" title="Apache Ant">Ant</a> pour décrire les tâches de construction, avec une cohérence forte dans l'<a href="Interface_de_programmation" title="Interface de programmation">interface de programmation</a> des tâches.
</p><p>L'outil a été développé pour la compilation d'exécutables multi-projets, qui tendent à être gourmands en espace. Son fonctionnement est basé sur une série de tâches de compilation qui sont exécutées de manière sérielle ou en parallèle. La <a href="Compilation_incr%C3%A9mentale" title="Compilation incrémentale">compilation incrémentale</a> est supportée en déterminant quelles portions de l'arbre de compilation sont encore à jour ; toute tâche ne dépendant que de ces parties ne sera pas réexécutée. Gradle supporte entre autres la mise en cache des composantes de compilation intermédiaires, composantes pouvant aussi être réparties sur un réseau commun. Un <a href="Service_web" title="Service web">service web</a> permet une visualisation des étapes de la compilation. Finalement, un système de <i>plugin</i> permet d'étendre les fonctionnalités du logiciel afin de supporter des fonctionnalités supplémentaires et d'autres <a href="Langage_de_programmation" title="Langage de programmation">langages de programmation</a>.
</p><p>Gradle est un <a href="Logiciel_libre" title="Logiciel libre">logiciel libre</a> distribué sous la licence <a href="Licence_Apache" title="Licence Apache">Licence Apache 2.0</a>. Sa version initiale date de 2007.
</p>
<div class="mw-heading mw-heading2"><h2 id="Présentation"><span id="Pr.C3.A9sentation"></span>Présentation</h2></div>
<p>Gradle permet d'écrire des tâches de construction dans un fichier de construction en utilisant le <a href="Langage_d%C3%A9di%C3%A9" title="Langage dédié">langage dédiée</a> basé sur <a href="Groovy_(langage)" title="Groovy (langage)">Groovy</a> ou <a href="Kotlin_(langage)" title="Kotlin (langage)">Kotlin</a>. Il est possible d'importer des tâches standards qui permettent de construire des programmes utilisant un ou plusieurs langages (Java, Groovy…) ou qui permettent d’exécuter des activités d’<a href="G%C3%A9nie_logiciel" title="Génie logiciel">ingénierie logicielle</a> telles qu'exécuter les <a href="Test_unitaire" title="Test unitaire">tests unitaires</a>, assurer la <a href="Qualit%C3%A9_logicielle" title="Qualité logicielle">qualité du code</a> (<a href="SonarQube" title="SonarQube">SonarQube</a>, <a href="Checkstyle" title="Checkstyle">Checkstyle</a>)…
</p><p>Gradle reprend certaines des idées fortes de Maven :
</p>
<ul><li><a href="Convention_plut%C3%B4t_que_configuration" title="Convention plutôt que configuration">convention plutôt que configuration</a></li>
<li>cycle de vie</li>
<li>gestion des dépendances à la manière d'<a href="Apache_Ivy" title="Apache Ivy">Apache Ivy</a> ou Maven</li>
<li>référentiel (ou entrepôts)</li></ul>
<p>Gradle présente les avantages suivants :
</p>
<ul><li>possibilité de scripter la construction en Groovy dans le fichier de construction ;</li>
<li>possibilité de changer le comportement par défaut de certaines tâches ;</li>
<li>une notation compacte pour décrire les dépendances ;</li>
<li>un moteur de production pensé pour produire des projets multi-langages.</li></ul>
<p>Gradle permet de construire sans effort des projets utilisant d'autres langages que Java<sup id="cite_ref-aladecouvertedeGradle_3-0" class="reference"><a href="#cite_note-aladecouvertedeGradle-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>. Migrer de Maven vers Gradle se fait très facilement pour un projet respectant les conventions Maven<sup id="cite_ref-aladecouvertedeGradle_3-1" class="reference"><a href="#cite_note-aladecouvertedeGradle-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Exemple_pour_un_projet_Java">Exemple pour un projet Java</h2></div>
<p>Voici le fichier <b>build.gradle</b> :
</p>
<div class="mw-highlight mw-highlight-lang-groovy mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="n">apply</span><span class="w"> </span><span class="nl">plugin:</span><span class="w"> </span><span class="s1">'java'</span>
</pre></div>
<p>Executer <b>gradle build</b> donne la sortie suivante :
</p>
<div class="mw-highlight mw-highlight-lang-text mw-content-ltr" dir="ltr"><pre><span></span>> gradle build
:compileJava
:processResources
:classes
:jar
:assemble
:compileTestJava
:processTestResources
:testClasses
:test
:check
:build
BUILD SUCCESSFUL
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Notes_et_références"><span id="Notes_et_r.C3.A9f.C3.A9rences"></span>Notes et références</h2></div>
<div class="references-small decimal" style=""><div class="mw-references-wrap"><ol class="references">
<li id="cite_note-wikidata-9e43a42fa799faa6409172039a9815a3e7ff29da-1"><span class="mw-cite-backlink"><a href="#cite_ref-wikidata-9e43a42fa799faa6409172039a9815a3e7ff29da_1-0">↑</a> </span><span class="reference-text"><span class="ouvrage">« <a rel="nofollow" class="external text" href="https://gradle.com/our-story/"><cite style="font-style:normal;">https://gradle.com/our-story/</cite></a> »</span></span>
</li>
<li id="cite_note-wikidata-54ce5103475c63d43ee3601e998746c68b1934a3-2"><span class="mw-cite-backlink"><a href="#cite_ref-wikidata-54ce5103475c63d43ee3601e998746c68b1934a3_2-0">↑</a> </span><span class="reference-text"><span class="ouvrage">« <a rel="nofollow" class="external text" href="https://github.com/gradle/gradle/releases/tag/v9.2.0"><cite style="font-style:normal;"><span class="lang-en" lang="en">Release 9.2.0</span></cite></a> », <time class="nowrap" datetime="2025-10-29" data-sort-value="2025-10-29">29 octobre 2025</time></span></span>
</li>
<li id="cite_note-aladecouvertedeGradle-3"><span class="reference-text"><a rel="nofollow" class="external text" href="http://connect.ed-diamond.com/GNU-Linux-Magazine/GLMF-141/Build-automatise-a-la-decouverte-de-Gradle">Build automatisé : à la découverte de Gradle</a>, par Gaylord Mazelier</span>
</li>
</ol></div>
</div>
<div class="mw-heading mw-heading2"><h2 id="Annexes">Annexes</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Articles_connexes">Articles connexes</h3></div>
<ul><li><a href="Apache_Maven" title="Apache Maven">Apache Maven</a></li></ul>
<ul id="bandeau-portail" class="bandeau-portail"><li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail de la programmation informatique</span> </span></li> <li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail des logiciels libres</span> </span></li> </ul></div><!--htdig_noindex--><div><div class="zim-footer">
Cet article est issu de <a class="external text" title="Dernière modification le 2024-12-03" href="https://fr.wikipedia.org/wiki/?title=Gradle&oldid=220832198">Wikipédia</a>. Sauf mention contraire, le texte est disponible sous <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">Creative Commons Attribution-Share Alike 4.0</a>. Des conditions supplémentaires peuvent s’appliquer aux fichiers multimédias.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>
</body></html>